]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
browser-plugin: Fix memory leak when passing an invalid UUID
authorJasper St. Pierre <jstpierre@mecheye.net>
Tue, 6 Dec 2011 20:00:52 +0000 (15:00 -0500)
committerJasper St. Pierre <jstpierre@mecheye.net>
Thu, 8 Dec 2011 16:50:35 +0000 (11:50 -0500)
https://bugzilla.gnome.org/show_bug.cgi?id=665261

browser-plugin/browser-plugin.c

index fccb0616b6cafabd23109265f9914a2c65c533d0..a80a4924f76d0f5859432105f75edd937abf8893 100644 (file)
@@ -480,7 +480,10 @@ plugin_install_extension (PluginObject *obj,
 {
   gchar *uuid_str = g_strndup (uuid.UTF8Characters, uuid.UTF8Length);
   if (!uuid_is_valid (uuid_str))
-    return FALSE;
+    {
+      g_free (uuid_str);
+      return FALSE;
+    }
 
   g_dbus_proxy_call (obj->proxy,
                      "InstallRemoteExtension",
@@ -509,7 +512,10 @@ plugin_uninstall_extension (PluginObject *obj,
 
   uuid_str = g_strndup (uuid.UTF8Characters, uuid.UTF8Length);
   if (!uuid_is_valid (uuid_str))
-    return FALSE;
+    {
+      g_free (uuid_str);
+      return FALSE;
+    }
 
   res = g_dbus_proxy_call_sync (obj->proxy,
                                 "UninstallExtension",
@@ -543,7 +549,10 @@ plugin_get_info (PluginObject *obj,
 
   uuid_str = g_strndup (uuid.UTF8Characters, uuid.UTF8Length);
   if (!uuid_is_valid (uuid_str))
-    return FALSE;
+    {
+      g_free (uuid_str);
+      return FALSE;
+    }
 
   res = g_dbus_proxy_call_sync (obj->proxy,
                                 "GetExtensionInfo",
@@ -576,7 +585,10 @@ plugin_get_errors (PluginObject *obj,
 
   uuid_str = g_strndup (uuid.UTF8Characters, uuid.UTF8Length);
   if (!uuid_is_valid (uuid_str))
-    return FALSE;
+    {
+      g_free (uuid_str);
+      return FALSE;
+    }
 
   res = g_dbus_proxy_call_sync (obj->proxy,
                                 "GetExtensionErrors",